HEADERS=../include/analyzer.h ../include/coder.h ../include/gerror.h
HEADERS+= ../include/invocation.h ../include/rawdata.h ../include/bitstream.h
HEADERS+= ../include/compresseddata.h ../include/golomb.h ../include/log.h

LOPT= -L/usr/lib -lpython2.7
COPT= -I../include -I/usr/include/python2.7 -O3 -Wall 
OUT= ../bin/
OBJ= objects
OBJECTS= $(OBJ)/analyzer.o $(OBJ)/bitstream.o $(OBJ)/coder.o 
OBJECTS+= $(OBJ)/compresseddata.o $(OBJ)/gerror.o $(OBJ)/golomb.o $(OBJ)/invocation.o  
OBJECTS+= $(OBJ)/log.o $(OBJ)/rawdata.o

golomb: $(OBJECTS)
	@if [ ! -d $(OUT) ] ; then mkdir $(OUT) ; fi 
	g++ -o $(OUT)golomb $^ $(LOPT)
	
$(OBJ)/analyzer.o: analyzer.cpp $(HEADERS)
	@mkdir -p $(OBJ)
	g++ $(COPT) -o $@ -c analyzer.cpp
	 
$(OBJ)/bitstream.o: bitstream.cpp $(HEADERS)
	@mkdir -p $(OBJ)
	g++ $(COPT) -o $@ -c bitstream.cpp
	 
$(OBJ)/coder.o: coder.cpp $(HEADERS)
	@mkdir -p $(OBJ)
	g++ $(COPT) -o $@ -c coder.cpp
	 
$(OBJ)/compresseddata.o: compresseddata.cpp $(HEADERS)
	@mkdir -p $(OBJ)
	g++ $(COPT) -o $@ -c compresseddata.cpp
	
$(OBJ)/gerror.o: gerror.cpp $(HEADERS)
	@mkdir -p $(OBJ)
	g++ $(COPT) -o $@ -c gerror.cpp
	
$(OBJ)/golomb.o: golomb.cpp $(HEADERS)
	@mkdir -p $(OBJ)
	g++ $(COPT) -o $@ -c golomb.cpp
	
$(OBJ)/invocation.o: invocation.cpp $(HEADERS)
	@mkdir -p $(OBJ)
	g++ $(COPT) -o $@ -c invocation.cpp
	
$(OBJ)/log.o: log.cpp $(HEADERS)
	@mkdir -p $(OBJ)
	g++ $(COPT) -o $@ -c log.cpp
	
$(OBJ)/rawdata.o: rawdata.cpp $(HEADERS)
	@mkdir -p $(OBJ)
	g++ $(COPT) -o $@ -c rawdata.cpp
	
